<?php

$NOT_LOGGED_IN = "You need to log in.  Your session has expired.";

if (session_id() == '')
{
  ini_set("session.use_cookies", 0);
  if (isset($_GET[session_name()]))
  {
    session_id($_GET[session_name()]);
  }
  else if (isset($_POST[session_name()]))
  {
    session_id($_POST[session_name()]);
  }
  else
  {
    //header('HTTP/1.1 405 No session');
    echo $NOT_LOGGED_IN;
    exit(1);
  }
  session_start();
}

if (!isset($_SESSION['config_dir']))
{
  //header('HTTP/1.1 405 No session');
  echo $NOT_LOGGED_IN;
  exit(1);
}

function getSID()
{
  return session_name().'='.session_id();
}
?>
